Skip to content

fix(integrations): show disabled role combobox for readonly members#3921

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/members-table
Apr 3, 2026
Merged

fix(integrations): show disabled role combobox for readonly members#3921
waleedlatif1 merged 1 commit intostagingfrom
fix/members-table

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Readonly users in the integrations members table now see the same disabled Combobox as admins instead of an unstyled badge
  • Collapsed duplicate Combobox JSX into a single instance with conditional disabled/onChange props
  • Extracted roleComboOptions to module level to avoid per-render allocations

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 3, 2026 10:56pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 3, 2026

PR Summary

Low Risk
Low risk UI-only change to the integrations members table; main concern is minor permission/disable-state regressions for member role editing/removal.

Overview
Readonly users now see the same (disabled) role Combobox in the integrations members table instead of a separate badge-style role display.

The role selector JSX is deduplicated into a single Combobox with conditional disabled logic, and roleComboOptions is hoisted to module scope to avoid per-render allocations.

Reviewed by Cursor Bugbot for commit 768eda9. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 3, 2026

Greptile Summary

This PR fixes a visual inconsistency in the integrations members table where readonly (non-admin) users saw an unstyled Badge for their role instead of the same disabled Combobox that sole-admin members saw. The fix collapses two conditional Combobox branches into one, controlled by a unified disabled prop (!isSelectedAdmin || (member.role === 'admin' && adminMemberCount <= 1)), and lifts the roleComboOptions mapping to module scope to avoid per-render object allocation.

  • Bug fixed: Readonly members now see a consistent, disabled Combobox matching the admin-row UI.
  • Refactor: Duplicate Combobox JSX collapsed into a single instance; roleComboOptions extracted to module level.
  • Layout preserved: The 3-column grid [1fr_120px_72px] for member rows is unaffected — the third column still renders either a Remove button (for admins) or an empty <div /> (for non-admins).
  • No logic regressions: The onChange handler is always wired but the Combobox is disabled for non-admins, so handleChangeMemberRole cannot be triggered from the UI in that case.

Confidence Score: 5/5

Safe to merge — the change is a targeted UI fix with no risk of data mutation for readonly users.

All findings are P2 or lower. The core logic is correct: the disabled expression exactly mirrors the previous per-branch logic, the grid layout is preserved, and onChange cannot fire on a disabled Combobox. No tests were added but the change is purely presentational.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/settings/components/integrations/integrations-manager.tsx Deduplicates the role Combobox JSX for member rows — non-admin (readonly) users now see a disabled Combobox instead of an unstyled Badge, and roleComboOptions is lifted to module scope.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Render member row] --> B{isSelectedAdmin?}
    B -- Yes --> C[Combobox: disabled if sole admin]
    B -- No --> D[Combobox: always disabled]
    C --> E{isSelectedAdmin?}
    D --> E
    E -- Yes --> F[Remove Button]
    E -- No --> G[empty div]
Loading

Reviews (1): Last reviewed commit: "fix(integrations): show disabled role co..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit e96ecdb into staging Apr 3, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/members-table branch April 3, 2026 23:00
@waleedlatif1 waleedlatif1 restored the fix/members-table branch April 4, 2026 23:43
@waleedlatif1 waleedlatif1 deleted the fix/members-table branch April 5, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant